package cn.izeno.wx.models.mp

import com.alibaba.fastjson.annotation.JSONField

class TempMessageParam(
    val accessToken: String,
    @field:JSONField(name = "touser")
    val openid: String,
    @field:JSONField(name = "template_id")
    val tempId: String,
    val url: String,
    @field:JSONField(name = "topcolor")
    val color: String
) {
  val data = HashMap<String, Value>()

  operator fun set(key: String, value: Value?) {
    if (value == null) data.remove(key)
    else data[key] = value
  }

  class Value(val value: String, color: String)
}